home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / NextAnswers / 1419_running_NXRunAlertPanel_while_printing.rtf < prev    next >
Text File  |  1993-11-08  |  2KB  |  37 lines

  1. {\rtf0\ansi{\fonttbl\f0\fnil Times-Roman;\f1\fmodern Courier;\f2\fmodern Ohlfs;}
  2. \paperw11240
  3. \paperh7740
  4. \margl120
  5. \margr120
  6. {\colortbl;\red84\green84\blue84;\red83\green83\blue83;}
  7. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f0\b0\i0\ulnone\fs28\fc0\cf0 Q: During printing, the view that is printing can't also write to the screen using a modal panel.  If I want to query the user for values to pass to the printing machinery while printing, such as adjusting the percentage of a view to be pushed to the next page, I can't use 
  8. \b NXRunAlertPanel
  9. \b0 ().\
  10. \
  11. A: Yes, this is true.  During printing the active PostScript context is pointing at the printer—thus all PostScript to draw your panel goes to the printer and not the screen. The solution is to temporarily divert the PostScript to the Window Server context with something like:
  12. \fs24 \
  13. \
  14.  
  15. \pard\tx740\tx1420\tx2040\tx2780\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\f1\fc0\cf0     \{\
  16.         DPSContext oldContext;\
  17.         short oldStatus;\
  18.         \
  19.         oldContext = DPSGetCurrentContext();\
  20.         DPSSetContext([NXApp context]);    // talk to the server\
  21.         oldStatus = NXDrawingStatus;\
  22.         NXDrawingStatus = NX_DRAWING;\
  23. \
  24.         // You can do drawing to the screen here; use\
  25.         // NXRunAlertPanel(), etc...\
  26. \
  27.         NXDrawingStatus = oldStatus;\
  28.         DPSSetContext(oldContext);    // return to talking to printer\
  29.     \}\
  30. \
  31.  
  32. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f0\fs28\fc0\cf0 QA368\
  33. \
  34. Valid for 1.0, 2.0, 3.0\
  35. \
  36.  
  37.